.class public Les/l30;
.super Landroid/database/sqlite/SQLiteOpenHelper;
.source "AutoBackUpCache.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Les/l30$f;
    }
.end annotation


# static fields
.field private static volatile c:Les/l30;


# instance fields
.field private a:Landroid/database/sqlite/SQLiteDatabase;

.field private b:I


# direct methods
.method private constructor <init>(Landroid/content/Context;)V
    .locals 3

    const-string v0, "auto_backup.db"

    const/4 v1, 0x0

    const/4 v2, 0x1

    .line 1
    invoke-direct {p0, p1, v0, v1, v2}, Landroid/database/sqlite/SQLiteOpenHelper;-><init>(Landroid/content/Context;Ljava/lang/String;Landroid/database/sqlite/SQLiteDatabase$CursorFactory;I)V

    const/4 p1, 0x0

    .line 2
    iput p1, p0, Les/l30;->b:I

    return-void
.end method

.method static synthetic a(Les/l30;)Landroid/database/sqlite/SQLiteDatabase;
    .locals 0

    .line 1
    iget-object p0, p0, Les/l30;->a:Landroid/database/sqlite/SQLiteDatabase;

    return-object p0
.end method

.method public static a(Landroid/content/Context;)Les/l30;
    .locals 2

    .line 2
    sget-object v0, Les/l30;->c:Les/l30;

    if-nez v0, :cond_0

    .line 3
    const-class v0, Les/l30;

    monitor-enter v0

    .line 4
    :try_start_0
    new-instance v1, Les/l30;

    invoke-virtual {p0}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;

    move-result-object p0

    invoke-direct {v1, p0}, Les/l30;-><init>(Landroid/content/Context;)V

    sput-object v1, Les/l30;->c:Les/l30;

    .line 5
    monitor-exit v0

    goto :goto_0

    :catchall_0
    move-exception p0

    monitor-exit v0
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw p0

    .line 6
    :cond_0
    :goto_0
    sget-object p0, Les/l30;->c:Les/l30;

    return-object p0
.end method

.method private a()V
    .locals 1

    .line 28
    monitor-enter p0

    .line 29
    :try_start_0
    iget v0, p0, Les/l30;->b:I

    add-int/lit8 v0, v0, 0x1

    iput v0, p0, Les/l30;->b:I

    .line 30
    iget-object v0, p0, Les/l30;->a:Landroid/database/sqlite/SQLiteDatabase;

    if-eqz v0, :cond_0

    .line 31
    monitor-exit p0

    return-void

    :cond_0
    const/4 v0, 0x0

    .line 32
    invoke-static {v0}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;

    move-result-object v0

    invoke-direct {p0, v0}, Les/l30;->a(Ljava/lang/Boolean;)V

    .line 33
    monitor-exit p0

    return-void

    :catchall_0
    move-exception v0

    monitor-exit p0
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v0
.end method

.method private a(Ljava/lang/Boolean;)V
    .locals 0

    .line 34
    :try_start_0
    invoke-virtual {p1}, Ljava/lang/Boolean;->booleanValue()Z

    move-result p1

    if-eqz p1, :cond_0

    sget-object p1, Les/l30;->c:Les/l30;

    invoke-virtual {p1}, Landroid/database/sqlite/SQLiteOpenHelper;->getReadableDatabase()Landroid/database/sqlite/SQLiteDatabase;

    move-result-object p1

    goto :goto_0

    :cond_0
    sget-object p1, Les/l30;->c:Les/l30;

    invoke-virtual {p1}, Landroid/database/sqlite/SQLiteOpenHelper;->getWritableDatabase()Landroid/database/sqlite/SQLiteDatabase;

    move-result-object p1

    :goto_0
    iput-object p1, p0, Les/l30;->a:Landroid/database/sqlite/SQLiteDatabase;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    :catch_0
    return-void
.end method

.method private a(Les/l30$f;)Z
    .locals 2

    const/4 v0, 0x1

    if-nez p1, :cond_0

    return v0

    .line 19
    :cond_0
    :try_start_0
    invoke-direct {p0}, Les/l30;->a()V

    .line 20
    iget-object v1, p0, Les/l30;->a:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {v1}, Landroid/database/sqlite/SQLiteDatabase;->beginTransaction()V

    .line 21
    invoke-interface {p1}, Les/l30$f;->a()Z

    move-result v0

    if-eqz v0, :cond_1

    .line 22
    iget-object p1, p0, Les/l30;->a:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {p1}, Landroid/database/sqlite/SQLiteDatabase;->setTransactionSuccessful()V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    goto :goto_0

    :catchall_0
    move-exception p1

    .line 23
    iget-object v0, p0, Les/l30;->a:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {v0}, Landroid/database/sqlite/SQLiteDatabase;->endTransaction()V

    .line 24
    invoke-virtual {p0}, Les/l30;->close()V

    .line 25
    throw p1

    .line 26
    :catch_0
    :cond_1
    :goto_0
    iget-object p1, p0, Les/l30;->a:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {p1}, Landroid/database/sqlite/SQLiteDatabase;->endTransaction()V

    .line 27
    invoke-virtual {p0}, Les/l30;->close()V

    return v0
.end method


# virtual methods
.method public a(I)Ljava/util/ArrayList;
    .locals 2
    .annotation build Landroidx/annotation/WorkerThread;
    .end annotation

    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(I)",
            "Ljava/util/ArrayList<",
            "Les/o30;",
            ">;"
        }
    .end annotation

    .line 9
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    .line 10
    new-instance v1, Les/l30$c;

    invoke-direct {v1, p0, p1, v0}, Les/l30$c;-><init>(Les/l30;ILjava/util/ArrayList;)V

    .line 11
    invoke-direct {p0, v1}, Les/l30;->a(Les/l30$f;)Z

    return-object v0
.end method

.method public a(Ljava/lang/String;)Ljava/util/ArrayList;
    .locals 2
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/String;",
            ")",
            "Ljava/util/ArrayList<",
            "Les/p30;",
            ">;"
        }
    .end annotation

    .line 16
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    .line 17
    new-instance v1, Les/l30$a;

    invoke-direct {v1, p0, p1, v0}, Les/l30$a;-><init>(Les/l30;Ljava/lang/String;Ljava/util/ArrayList;)V

    .line 18
    invoke-direct {p0, v1}, Les/l30;->a(Les/l30$f;)Z

    return-object v0
.end method

.method public a(Les/o30;)Z
    .locals 1

    .line 12
    new-instance v0, Les/l30$d;

    invoke-direct {v0, p0, p1}, Les/l30$d;-><init>(Les/l30;Les/o30;)V

    .line 13
    invoke-direct {p0, v0}, Les/l30;->a(Les/l30$f;)Z

    move-result p1

    return p1
.end method

.method public a(Les/p30;)Z
    .locals 1

    .line 14
    new-instance v0, Les/l30$e;

    invoke-direct {v0, p0, p1}, Les/l30$e;-><init>(Les/l30;Les/p30;)V

    .line 15
    invoke-direct {p0, v0}, Les/l30;->a(Les/l30$f;)Z

    move-result p1

    return p1
.end method

.method public a(Ljava/util/ArrayList;)Z
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/ArrayList<",
            "Les/o30;",
            ">;)Z"
        }
    .end annotation

    .line 7
    new-instance v0, Les/l30$b;

    invoke-direct {v0, p0, p1}, Les/l30$b;-><init>(Les/l30;Ljava/util/ArrayList;)V

    .line 8
    invoke-direct {p0, v0}, Les/l30;->a(Les/l30$f;)Z

    move-result p1

    return p1
.end method

.method public close()V
    .locals 1

    .line 1
    monitor-enter p0

    .line 2
    :try_start_0
    iget v0, p0, Les/l30;->b:I

    .line 3
    iget v0, p0, Les/l30;->b:I

    add-int/lit8 v0, v0, -0x1

    iput v0, p0, Les/l30;->b:I

    if-nez v0, :cond_0

    .line 4
    iget-object v0, p0, Les/l30;->a:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {v0}, Landroid/database/sqlite/SQLiteDatabase;->close()V

    const/4 v0, 0x0

    .line 5
    iput-object v0, p0, Les/l30;->a:Landroid/database/sqlite/SQLiteDatabase;

    .line 6
    :cond_0
    monitor-exit p0

    return-void

    :catchall_0
    move-exception v0

    monitor-exit p0
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v0
.end method

.method public onCreate(Landroid/database/sqlite/SQLiteDatabase;)V
    .locals 1

    const-string v0, "CREATE TABLE IF NOT EXISTS folder_table (folder_id INTEGER PRIMARY KEY,folder_type INTEGER,folder_path TEXT not null, UNIQUE(folder_type,folder_path))"

    .line 1
    invoke-virtual {p1, v0}, Landroid/database/sqlite/SQLiteDatabase;->execSQL(Ljava/lang/String;)V

    const-string v0, "CREATE TABLE IF NOT EXISTS file_backup_table (id INTEGER PRIMARY KEY,full_path TEXT not null,up_time INTEGER,hash TEXT,dest TEXT not null)"

    .line 2
    invoke-virtual {p1, v0}, Landroid/database/sqlite/SQLiteDatabase;->execSQL(Ljava/lang/String;)V

    return-void
.end method

.method public onUpgrade(Landroid/database/sqlite/SQLiteDatabase;II)V
    .locals 0

    return-void
.end method
